home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Internet / WWW / Perl_WWW_Utilities / total / rand_image / rand_image.pl next >
Encoding:
Perl Script  |  1996-01-02  |  862 b   |  30 lines

  1. #! /usr/local/bin/perl
  2. # Random Image Displayer
  3. # Version 1.2 Created by: Matt Wright
  4. # Created On: 7/1/95            Last Modified: 7/17/95
  5. # I can be reached at:  mattw@misha.net
  6. # Scripts Archive at:    http://worldwidemart.com/scripts/
  7. # The file README contains more information and installation instructions.
  8.  
  9. # Necessary Variables
  10.   $basedir = "http://alpha.pr1.k12.co.us/~mattw/image/pics/";
  11.   @files = ("waterfalls.gif","test.gif","random.gif","neat.jpg");
  12.  
  13. # Options
  14.   $uselog = 0; # 1 = YES; 0 = NO
  15.         $logfile = "/home/mattw/public_html/image/pics/piclog";
  16.  
  17.   srand;
  18.   $num = rand(@files); # Pick a Random Number
  19.  
  20. # Print Out Header With Random Filename and Base Directory
  21.   print "Location: $basedir$files[$num]\n\n";
  22.  
  23. # Log Image
  24.   if ($uselog eq '1') {
  25.      open (LOG, ">>$logfile");
  26.      print LOG "$files[$num]\n";
  27.      close (LOG);
  28.   }
  29. exit;
  30.